/**
 * @license
 * Copyright 2024 The Model Explorer Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ==============================================================================
 */

.container {
  .mat-icon-container {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.85;

    &:hover {
      opacity: 1;
    }

    mat-icon {
      font-size: 20px;
      width: 20px;
      height: 20px;
    }
  }
}

::ng-deep bubble-container:has(.model-explorer-edge-overlays-popup) {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

::ng-deep .model-explorer-edge-overlays-popup {
  padding: 12px;
  padding-top: 10px;
  font-size: 12px;
  color: var(--me-on-surface-color);
  background-color: var(--me-surface-container-low-color);
  display: flex;
  flex-direction: column;

  .icon-container {
    cursor: pointer;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      opacity: 1;
    }

    mat-icon {
      font-size: 16px;
      width: 16px;
      height: 16px;
      color: var(--me-on-surface-variant-color);
    }
  }

  .label {
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 170px;

    &:not(:first-child) {
      margin-top: 12px;
    }

    .right-wrapper {
      display: flex;
      align-items: center;
      gap: 4px;
    }
  }

  .loaded-overlays-container {
    display: flex;
    flex-direction: column;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--me-outline-variant-color);
    gap: 8px;

    .no-overlays-label {
      color: var(--me-on-surface-variant-color);
    }

    .overlay-set-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 700;
      line-height: 15px;
      word-break: break-all;
      margin-bottom: 4px;
    }

    .overlay-item {
      display: flex;
      flex-direction: column;

      .overlay-name {
        display: flex;
        align-items: center;
        justify-content: space-between;
      }

      .overlay-controls {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .show-edges-connected-to-selected-node-only {
        margin-left: 20px;
      }

      .max-hops-container {
        display: flex;
        align-items: center;
        gap: 4px;
        align-self: flex-end;

        input {
          width: 36px;
        }
      }

      label {
        display: flex;
        align-items: center;
        cursor: pointer;
        line-height: 15px;
        word-break: break-all;
        gap: 4px;
        user-select: none;

        input {
          cursor: pointer;
        }
      }

      .view-label {
        cursor: pointer;
        color: var(--me-primary-color);
        opacity: 0.8;
        user-select: none;
        line-height: 15px;

        &:hover {
          opacity: 1;
        }
      }
    }
  }

  .upload-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 16px 0 0;
    margin-top: 12px;
  }

  .upload-json-file-button {
    margin: 4px 0;
    width: 90px;
    height: 30px;
    /* stylelint-disable-next-line declaration-no-important -- override MDC */
    font-size: 12px !important;
    /* stylelint-disable-next-line declaration-no-important -- override MDC */
    letter-spacing: normal !important;
    background-color: var(--me-primary-color);
    color: var(--me-on-primary-color);

    &.upload {
      margin-top: 2px;
    }

    &[disabled] {
      color: var(--me-on-surface-variant-color);
      background-color: var(--me-surface-container-highest-color);
    }

    ::ng-deep .mat-mdc-button-touch-target {
      display: none;
    }
  }

  .or-divider {
    height: 1px;
    border-top: 1px solid var(--me-outline-hairline-color);
    position: relative;
    margin-top: 12px;

    .or-label {
      font-size: 10px;
      top: -12px;
      color: var(--me-on-surface-low-color);
      position: absolute;
      padding: 2px;
      background-color: var(--me-surface-container-low-color);
      display: flex;
      align-items: center;
      justify-content: center;
      width: 16px;
      left: calc(50% - 8px);
    }
  }

  .upload-json-file-input {
    display: none;
  }
}
